package cn.edu.cqut.test3;

public class village {
    static int WaterAmount;
    int peopleNumber;
    String name;
    village(String s)
    {
        name=s;
    }
    static void setWaterAmount(int m)
    {
   if(m>0)
       WaterAmount=m;
    }
    void drinkWater(int n)
    {
        if(WaterAmount-n>=0) {
            WaterAmount = WaterAmount - n;
            System.out.println(name + "喝了" + n + "升水");
        }
        else {
            WaterAmount=0;
        }
    }
    static int lookWaterAmount()
    {
        return WaterAmount;
    }
    void setPeopleNumber(int n)
    {
        peopleNumber=n;
    }
int getPeopleNumber()
{return peopleNumber;}


}
